package com.cloudkinto.controller.covershows;

import com.cloudkinto.service.covershows.ThymeleafShowNoticeService;
import com.cloudkinto.service.statistics.vo.NotificationPageRes;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author fanp
 * @version v1.0.0
 * @Description :
 * @Create on : 2021/3/25 15:14
 **/
@Controller
@RequestMapping("/notice")
public class ThymeleafShowNoticeController {
    @Autowired
    private ThymeleafShowNoticeService service;

    @RequestMapping("/showNotice/{current}/{pageSize}")
    public String showNotice(Model model, @PathVariable(required = false, value = "current") String current,
                             @PathVariable(value = "pageSize") String pageSize) {
        Map<String, String> map = new HashMap<>();
        map.put("current", current);
        map.put("pageSize", pageSize);
        List<NotificationPageRes> notificationPageRes = service.getListPage(map);
        model.addAttribute("dataMap",notificationPageRes);
        return "notice";
    }
}
